<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>矩形的周长和面积</title>
	<script type="text/javascript">
		var num1=Number(prompt('请输入矩形的长:'));
		var num2=Number(prompt('请输入矩形的宽:'));
		if (num1<=0||num2<=0) {
			console.log('请输入大于0的数！');
		}
		else{
			var len=2*(num1+num2);
			var area=num1*num2;
			console.log('矩形的周长为：'+len);
			console.log('矩形的面积为：'+area);
		}
	</script>
</head>
<body>
	
</body>
</html>